<!--<?php
require_once(uTemplate::printEot('header'));
//require_once(uTemplate::printEot('user_appleft'));
print <<<EOT
-->
<div class="contUser">
	<div class="p15">
		<div class="navC">
			<ul>
				<li id="a_friend"><a href="{$basename}a=friend">好友新帖</a></li>
				<li id="a_own"><a href="{$basename}">我的帖子</a></li>
<!--
EOT;
foreach($postcatedb as $value){
if ($value['pcid'] != 2) {print <<<EOT
-->
				<li id="a_pc{$value[pcid]}"><a href="{$basename}a=pc&pcid=$value[pcid]">$value[name]</a></li>
<!--
EOT;
}
}print<<<EOT
-->
				<li id="a_goods"><a href="{$basename}a=goods">我的商品</a></li>	
<!--
EOT;
$b = $a.$pcid;
$u && $u != $winduid && $b = 'friend';
$see == 'trade' && $b = 'trade';
print <<<EOT
-->
			</ul>
<script language="JavaScript">
setCurrent('a_$b','a_own','current');
</script>
		</div>
<!--
EOT;
if ($a == 'list') {print <<<EOT
-->
		<div class="sidebar fr">
			<div class="p10" style="padding-bottom:0;">
				<div class="boxC">
					<h3>类型筛选</h3>
					<ul class="ulE">
						<li id="a_article"><a href="{$basename}" >我的主题</a></li> 
						<li id="a_post" class="none"><a href="{$basename}see=post">我的回复</a></li>
					</ul>
<script language="JavaScript">setCurrent('a_$see','a_article','current');</script>
				</div>
			</div>
<!--
EOT;
	if ($see == 'topic') { print <<<EOT
-->
			<div class="p10">
				<div class="boxC">
						<h3>时间筛选</h3>
						<ul class="ulE">
						<li id="post_0"><a href="{$basename}posttime=0">所有主题</a></li>
						<li id="post_1"><a href="{$basename}posttime=1">1天内的主题</a></li>
						<li id="post_2"><a href="{$basename}posttime=2">2天内的主题</a></li>
						<li id="post_7"><a href="{$basename}posttime=7">1星期内的主题</a></li>
						<li id="post_30"><a href="{$basename}posttime=30">1个月内的主题</a></li>
						<li id="post_60"><a href="{$basename}posttime=60">2个月内的主题</a></li>
						<li id="post_90"><a href="{$basename}posttime=90">3个月内的主题</a></li>
						<li id="post_180"><a href="{$basename}posttime=180">6个月内的主题</a></li>
						<li id="post_365"><a href="{$basename}posttime=365">1年内的主题</a></li>
						<li id="post_366"><a href="{$basename}posttime=366">1年以上的主题</a></li>
						<script language="javascript">setCurrent('post_$posttime','post_0','current');</script>
						</ul>
				</div>
			</div>
<!--
EOT;
	}print <<<EOT
-->
		</div>
		<div class="contentB">
			<div class="p10 cc">
			<table width="100%" class="mb10" style="table-layout:fixed;">
				<tr class="tr2">
					<td width="25">&nbsp;</td>
					<td>
<!--
EOT;
if ($see == 'topic') { print <<<EOT
-->
					<a id="ot_postdate" href="{$basename}ordertype=postdate&u=$u">最新发帖</a>&nbsp;|&nbsp;<a id="ot_lastpost" href="{$basename}ordertype=lastpost&u=$u">回复时间</a><script language="JavaScript">setCurrent('ot_$ordertype','ot_postdate','b s5');</script>
<!--
EOT;
}print <<<EOT
-->
					</td>
					<td width="80" class="tac">回复/人气</td>
					<td width="140">所属版块/发表日期</td>
				</tr>
<!--
EOT;
if (!empty($article)) {
foreach ($article as $key => $value) {print <<<EOT
-->
				<tr class="tr3">
					<td width="20"><img src="images/wind/thread/topicnew.gif" /></td>
					<td class="f14">
<!--
EOT;
if ($see == 'post') {print <<<EOT
-->
						<a href="job.php?action=topost&tid=$value[tid]&pid=$value[pid]" class="s5">$value[subject]</a>	
<!--
EOT;
} else {print <<<EOT
-->
<!--
EOT;
if($topicmodeldb[$value[modelid]][name]){print <<<EOT
-->
						<span class="s2">[{$topicmodeldb[$value[modelid]][name]}]</span>
<!--
EOT;
}if($postcatedb[$value[pcid]][name]){print <<<EOT
-->
						<span class="s2">[{$postcatedb[$value[pcid]][name]}]</span>
<!--
EOT;
}print <<<EOT
-->
						<a href="read.php?tid=$value[tid]" class="s5" target="_blank">{$value[subject]}</a>
<!--
EOT;
}print <<<EOT
-->
					</td>
					<td class="tac"><span class="s2">{$value[replies]}</span><p class="f10 gray">{$value[hits]}</p></td>
					<td><a href="thread.php?fid=$value[fid]" class="s5">{$value[forum]}</a><p class="f10 gray">{$value[postdate]}</p></td>
				</tr>
<!--
EOT;
}} else {print <<<EOT
-->
<!--
EOT;
if ($see == 'topic') {print <<<EOT
-->
				<tr>
					<td colspan="4" class="p15 tac f14">暂无主题！</td>
				</tr>
<!--
EOT;
} elseif($see == 'post') {print <<<EOT
-->	
				<tr>
					<td colspan="4" class="p15 tac f14">暂无回复！</td>
				</tr>		
<!--
EOT;
}}print <<<EOT
-->
			</table>
			<div class="mb10 cc">$pages</div>
			</div>
		</div>
<!--
EOT;
} elseif ($a == 'friend') {print <<<EOT
-->
		<div class="p10">
			<table width="100%" class="mb10" style="table-layout:fixed;">
				<tr class="tr2">
					<td width="25">&nbsp;</td>
					<td>标题</td>
					<td width="80" class="tac">回复/人气</td>
					<td width="180">所属版块/作者/时间</td>
				</tr>
<!--
EOT;
if (!empty($article)) {
foreach ($article as $key => $value) {print <<<EOT
-->
				<tr class="tr3">
					<td width="20"><img src="images/wind/thread/topicnew.gif" /></td>
					<td class="f14">
<!--
EOT;
if($topicmodeldb[$value[modelid]][name]){print <<<EOT
-->
						<span class="s2">[{$topicmodeldb[$value[modelid]][name]}]</span>
<!--
EOT;
}if($postcatedb[$value[pcid]][name]){print <<<EOT
-->
						<span class="s2">[{$postcatedb[$value[pcid]][name]}]</span>
<!--
EOT;
}print <<<EOT
-->
						<a href="read.php?tid=$value[tid]" class="s5" target="_blank">{$value[subject]}</a>
					</td>
					<td class="tac"><span class="s2">{$value[replies]}</span><p class="f10 gray">{$value[hits]}</p></td>
					<td><a href="thread.php?fid=$value[fid]" class="s5">{$value[forum]}</a><p class="f10 gray"><a href="u.php?uid=$value[authorid]" class="s5 gray">$value[author]</a> {$value[postdate]}</p></td>
				</tr>
<!--
EOT;
}} else {print <<<EOT
-->
				<tr>
					<td colspan="4" class="p15 tac f14">暂无主题！</td>
				</tr>			
<!--
EOT;
}print <<<EOT
-->
			</table>
			<div class="mb10 cc">$pages</div>
		</div>
<!--
EOT;
} elseif ($a == 'pc') {
print <<<EOT
-->
		<div class="tips">
			<div class="navD">
				<ul class="cc">
					<li id="a_myjoin"><a href="{$basename}a=$a&see=myjoin">我参与的</a></li>
					<li id="a_mypost" class="none"><a href="{$basename}a=$a&see=mypost" >我发布的</a></li>
				</ul>
			</div>
		</div>
		<script language="JavaScript">setCurrent('a_$see','a_myjoin','current');</script>
		<table width="100%" class="tA mb10" style="table-layout:fixed;">
			<tr class="tr">
				<td>名称</td>
<!--
EOT;
if($pcid=='1'){print<<<EOT
-->
				<td width="60">购买数量</td>
<!--
EOT;
}elseif($pcid=='2'){print<<<EOT
-->
				<td width="60">报名人数</td>
<!--
EOT;
}print<<<EOT
-->
				<td width="110">发起人</td>
				<td width="80">状态</td>
				<td width="140">操作</td>
			</tr>
<!--
EOT;
foreach($article as $value){
    if($see=='mypost'){
        if($value['endtime']<$timestamp){
        	$state='<span class="gray">已结束</span>';
        }elseif($value['begintime']>$timestamp){
        	$state='<span class="s1">未开始</span>';
        }elseif($value['nums']>=$value['limitnum']){
        	$state='<span class="s1">人数已满</span>';
        }else{
        	$state='<span class="s3">报名中</span>';
        }
    }elseif($see=='myjoin'){
        if($value['endtime']<$timestamp){
        	$state='<span class="gray">已结束</span>';
        }elseif($value['ifpay']==1){
        	$state='<span class="s3">已支付</span>';
        }else{
        	$state='未支付';
        }
    }
!$value[nums] && $value[nums] = 0;
print<<<EOT
-->
			<tr>
				<td><a href="read.php?tid=$value[tid]" target="_blank" class="s5">$value[subject]</a></td>
				<td><a href="read.php?tid=$value[tid]#pcinfo" target="_blank">$value[nums]</a></td>
				<td><a href="u.php?uid=$value[authorid]" target="_blank">$value[author]</a></td>
				<td>$state</td>
				<td><a href="read.php?tid=$value[tid]#pcinfo" target="_blank" class="mr10">[详情]</a>
<!--
EOT;
if($see=='mypost'){print<<<EOT
--><a href="javascript:;" onclick="sendmsg('pw_ajax.php?action=pcsendmsg&tid=$value[tid]&pcid=$pcid','',this.id);" class="mr10">[群发]</a><a href="job.php?action=pcexport&tid=$value[tid]&pcid=$pcid">[导出]</a>
<!--
EOT;
}elseif($see=='myjoin' && $value['endtime']>$timestamp && $value[payway]==1 && $value[ifpay]!=1){
print<<<EOT
--><a id="alipay_$value[pcmid]" href="javascript:;" class="s1" onclick="sendmsg('pw_ajax.php?action=pcalipay&pcmid=$value[pcmid]&tid=$value[tid]&pcid=$pcid','',this.id);">[马上支付]</a>
<!--
EOT;
}print<<<EOT
-->
				</td>
			</tr>
<!--
EOT;
}print<<<EOT
-->
		</table>
		<div class="mb10 cc">$pages</div>
<!--
EOT;
} elseif ($a == 'goods') {print <<<EOT
-->
		<div class="tips">
			<div class="navD">
				<ul class="cc">
					<li id="a_trade"><a href="{$basename}a=$a&job=trade">已买入的商品</a></li>
					<li  id="a_onsale"><a href="{$basename}a=$a&job=onsale">出售中的商品</a></li>
					<li id="a_saled" class="none"><a href="{$basename}a=$a&job=saled">已卖出的商品</a></li>
				</ul>
			</div>
		</div>
		<script language="JavaScript">setCurrent('a_$job','a_trade','current');</script>
		<table width="100%" class="tA mb10" style="table-layout:fixed;">
<!--
EOT;
if ($job == 'trade') {print <<<EOT
-->
			<tr class="tr">
				<td width="130">商品图片</td>
				<td>商品名称</td>
				<td width="80">现价</td>
				<td width="100">卖家</td>
				<td width="120">交易状态</td>
			</tr>
<!--
EOT;
foreach ($trade as $key => $value) {
$value[icon] = !$value[icon] ? "images/noproduct.gif" : $value[icon];

if ($value['ifpay'] == 4) {
	$state = "<span class='s1'>交易失败</span>";
} elseif ($value['ifpay'] == 3) {
	$state = "<span class='s3'>交易完成</span>";
} elseif ($value['ifpay'] == 2) {
	$state = "卖家已发货，<br />确认收货";
} elseif ($value['ifpay'] == 1) {
    $state = "买家已付款，<br />等待卖家发货";    
} elseif ($value['ifpay'] == 0) {
     $state = "<span class='s3'>等待买家付款</span>";
}

print <<<EOT
-->
			<tr>
				<td><img src="$value[icon]" width="120" alt="$value[subject]" /></td>
				<td><a href="read.php?tid=$value[tid]" class="s5" target="_blank">$value[subject]</a></td>
				<td>$value[price]</td>
				<td><a href="u.php?uid=$value[seller]" target="_blank">$value[username]</a></td>
				<td><a class="mr10" href="trade.php?action=order&oid=$value[oid]" target="_blank">详情</a>$state</td>
			</tr>
<!--
EOT;
}print <<<EOT
-->

<!--
EOT;
} elseif ($job == 'onsale') {print <<<EOT
-->
			<tr class="tr">
				<td width="130">商品图片</td>
				<td>商品名称</td>
				<td width="80">现价</td>
				<td width="100">库存</td>
				<td width="60">售出数量</td>
			</tr>
<!--
EOT;
foreach ($trade as $key => $value) {
$value[icon] = !$value[icon] ? "images/noproduct.gif" : $value[icon];
$value[num] -= $value[salenum];
print <<<EOT
-->
			<tr class="tr3">
				<td><img src="$value[icon]" width="120" alt="$value[name]" /></td>
				<td><a href="read.php?tid=$value[tid]" class="s5" target="_blank">$value[name]</a></td>
				<td>$value[costprice]</td>
				<td>$value[num]</td>
				<td>$value[salenum]</td>
			</tr>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
} elseif ($job == 'saled') {
$value[icon] = !$value[icon] ? "images/noproduct.gif" : $value[icon];
print <<<EOT
-->
			<tr class="tr">
				<td width="130">商品图片</td>
				<td>商品名称</td>
				<td width="80">现价</td>
				<td width="100">买家</td>
				<td width="120">交易状态</td>
			</tr>						
<!--
EOT;
foreach ($trade as $key => $value) {


if ($value['ifpay'] == 4) {
        $state = "<span class='s1'>交易失败</span>";
} elseif ($value['ifpay'] == 3) {
        $state = "<span class='s3'>交易完成</span>";
} elseif ($value['ifpay'] == 2) {
		$state = "卖家已发货，<br />确认收货";
} elseif ($value['ifpay'] == 1) {
		$state = "买家已付款，<br />等待卖家发货";
} elseif ($value['ifpay'] == 0) {
        $state = "<span class='s1'>等待买家付款</span>";
}

print <<<EOT
-->
			<tr>
				<td><img src="$value[icon]" width="120" alt="" /></td>
				<td><a href="read.php?tid=$value[tid]" class="s5" target="_blank">$value[subject]</a></td>
				<td>$value[price]</td>
				<td><a href="u.php?uid=$value[buyer]" target="_blank">$value[username]</a></td>
				<td><a class="mr10" href="trade.php?action=order&oid=$value[oid]" target="_blank">详情</a>$state</td>
			</tr>
<!--
EOT;
}print <<<EOT
-->
<!--
EOT;
}print <<<EOT
-->
		</table>
		<div class="mb10 cc">$pages</div>                                 
<!--
EOT;
}print <<<EOT
-->
	<div class="c"></div>
	</div>
</div>
<!--
EOT;
require_once(uTemplate::printEot('footer'));
?>-->
